package com.tiza.xiaoyoubao.ui.fragment;

import android.os.Bundle;
import android.widget.TextView;

import com.tianze.library.base.BaseFragment;
import com.tiza.xiaoyoubao.R;
import com.tiza.xiaoyoubao.entity.CommissionListInfo;
import com.tiza.xiaoyoubao.utils.DateUtils;

import butterknife.BindView;

/**
 * Created by mapple on 17/4/4.
 * 佣金收益详情
 */

public class CommissionDetialFragment extends BaseFragment {

    @BindView(R.id.tv_transacionDetiali)
    TextView tv_transacionDetiali;
    @BindView(R.id.tv_transacionType)
    TextView tv_transacionType;
    @BindView(R.id.tv_transacionTime)
    TextView tv_transacionTime;
    @BindView(R.id.tv_transacionNumber)
    TextView tv_transacionNumber;
    @BindView(R.id.tv_descr)
    TextView tv_descr;
    private Bundle args;
    private CommissionListInfo mCommissionListInfo;
    @Override
    protected int getLayoutId() {
        return R.layout.detial_commission;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        args=getArguments();
        mCommissionListInfo = (CommissionListInfo) args.getSerializable("info");
        if (null == mCommissionListInfo) {
            toast("详情加载失败");
            finish();
        }
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        tv_transacionDetiali.setText(mCommissionListInfo.getMoneyPay());
        tv_transacionTime.setText(DateUtils.getDateToString(mCommissionListInfo.getPayTime()));
        tv_transacionType.setText(mCommissionListInfo.getType());
        tv_transacionNumber.setText(mCommissionListInfo.getId()+"");
        tv_descr.setText(mCommissionListInfo.getContent());
    }
}
